Repository navigation
fix(view): animate both edges when maximizing a tiled window to edges - #974
Open
minhduc17801 wants to merge 1 commit into
Open
minhduc17801 wants to merge 1 commit into
minhduc17801 wants to merge 1 commit into
Conversation
Setting the maximize-to-edges state re-presented the window at its new tile size through setMaximizedState before the deferred arrange ran. The layout motion then started from that box, so a narrower column showed its full width at once and only its position animated: the far edge jumped to the output edge in the first frame. Arrange right after the flag changes, before the state updates re-present the window, so the motion starts from the box on screen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
View::setMaximizedToEdgesnow arranges the workspace right after the maximize-to-edges flag changes, before the state updates that re-present the window. Maximizing a tiled column narrower than the output to edges now animates both edges together, the way fullscreen does, instead of showing its new width in the first frame and only animating the position.Motivation
With the scrolling layout, Mod+M (
window-toggle-maximize-to-edges) on a 1/2 or 1/3 width column visibly jerks: the far edge jumps to the output edge at once, then the near edge slides. From a full-width column the size barely changes, so it is not noticeable there.Cause: after the flag flips,
setMaximizedState→refreshStateRuleEffects→Workspace::syncViewPresentationpresents the window at its newtiledTargetBoxsize (the edges size) at its old node position, because nothing owns the presentation yet (cancelSizeAnimationreleased it). The deferred arrange then reads that box as the motion's start, sofromalready has the target size and only the position animates. Arranging immediately lets the layout motion take the presentation from the box actually on screen.Type of Change
Testing
animation/maximize_to_edgeswith a sample 1 ms after the action: the presented width must still be the starting width. Before, the check only sampled the midpoint, which this bug passes.just check-stress animation/maximize_to_edges 16→ 16 failed (before=628 start=954).628 → 954at +0 ms; after628 → 660 → 694 → 726 …. Same from 1/3 width. Restoring from edges, and a client that keeps a fixed-size buffer, animate in both versions.just test: 169/169 passed.just check(full suite): the same set of checks fails on my machine with and without this change (their clients never map in this environment), apart fromanimation/maximize_to_edges, which now passes.layout/tab_maximized_to_edges,scratchpad/maximized_to_edges,layout/maximized_tile_returnandinput/mod_right_double_click_maximizeare among those environment failures, with identical messages before and after, so they did not exercise this change here.just lint src/view/view_state.cpp: clean.just format-code: no changes.Manual Coverage
Checklist
SCOPE.md, or its scope was agreed in an issue or on Discord first.CONTRIBUTING.md.just format, or this PR has no C++, shader, or Markdown changes.docs/andexamples/config.toml, or this PR does not change user-facing configuration or behavior.Additional Notes
Verified in a nested session with ghostty: Alt+M from 1/2 and 1/3 width columns jerks with the current build and animates smoothly with this change. Tab groups and tiled scratchpads were not exercised manually, and their harness checks do not run in my environment (see Testing).